package java04;

import java.util.*;

class ArrayUtils {

	public static class PairResult {
		private double min;
		private double max;

		public PairResult(double min, double max) {
			super();
			this.min = min;
			this.max = max;
		}

		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}

	public static PairResult findMinMax(double[] values) {
		double min = values[0];
		double max = values[0];
		for (int i = 0; i < values.length; i++) {
			if (values[i] > max)
				max = values[i];
			if (values[i] < min)
				min = values[i];
		}
		PairResult x = new PairResult(min, max);
		return x;
	}
}

public class Java44 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		double[] arr = new double[n];
		for (int i = 0; i < n; i++) {
			arr[i] = in.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(arr));
		System.out.println(ArrayUtils.PairResult.class);
	}
}